/*
 * @Author: CoderLPF
 * @Date: 2020-03-22 23:19:06
 * @LastEditTime: 2020-04-21 08:34:55
 * @LastEditors: CoderLPF
 * @Description: 
 * @FilePath: \fzx-system-fd\src\store\user\index.js
 */
// 用户模块的菜单管理器
import persistedState from 'vuex-persistedstate';

export default {
    state: {
        userInfo: {},
        token: '',
        rights: [],
        roles: []
    },
    mutations: {
        reset(state) {
            state.userInfo = {};
            state.token = '';
            state.rights = {};
            state.roles = [];
        },
        initUserInfo: function(state, user) {
            state.userInfo = user;
        },
        setUserInfo: function(state, s) {
            state.userInfo = s;
        },
        saveRoleList: function(state, roles) {
            state.roles = roles;
        }
    },
    actions: {

    }
};